<?php
declare(strict_types=1);

namespace LowCode\Naive;

use LowCode\Naive;
use LowCode\Support\JsExp;
use LowCode\Traits\Props\HasHugeSize;
use LowCode\Traits\Slots\HasSlotExtra;
use LowCode\Traits\Slots\HasSlotIcon;

/**
 * NEmpty 空组件
 * @method static static make(string|JsExp $description = null, mixed $children = null) NEmpty组件
 */
class NEmpty extends Naive
{
    use HasSlotIcon, HasSlotExtra, HasHugeSize;

    /**
     * @param string|JsExp|null $description
     * @param mixed|null $children
     */
    public function __construct(string|JsExp $description = null, mixed $children = null)
    {
        parent::__construct("Empty");
        if ($description){
            $this->description($description);
        }
        $this->children($children);
    }

    /**
     * 描述信息
     * @param string|JsExp $description
     * @return $this
     */
    public function description(string|JsExp $description): static
    {
        return $this->prop("description",$description);
    }

    /**
     * 是否展示图标
     * @param bool|JsExp $bool
     * @return $this
     */
    public function showIcon(bool|JsExp $bool = true): static
    {
        return $this->prop('show-icon', $bool);
    }

    /**
     * 是否展示描述信息
     * @param bool|JsExp $bool
     * @return $this
     */
    public function showDescription(bool|JsExp $bool = true): static
    {
        return $this->prop('show-description', $bool);
    }

}
